using System.Windows.Forms;
using DZTC.UselessAppEver.Core;

namespace DZTC.UselessAppEver.UI
{
    public static class Dialog
    {
        public static void InvalidOptions(string message)
        {
            MessageBox.Show(message, Localization.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void IOError(string message)
        {
            MessageBox.Show(message, Localization.IOError, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void Base32Error(string message)
        {
            MessageBox.Show(message, Localization.Base32Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void PromptInputFileNotFound(string fileName)
        {
            MessageBox.Show(Localization.FileNotExist.AsFormat(fileName),
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }

        public static bool PromptOutputFileAlreadyExist(string fileName)
        {
            var result = MessageBox.Show(Localization.FileAlreadyEsistAreYouSure.AsFormat(fileName),
                                         Localization.Warning,
                                         MessageBoxButtons.YesNo,
                                         MessageBoxIcon.Warning);

            return result == DialogResult.Yes;
        }

        public static bool PromtOuptutFileDirectoryNotExist(string directory)
        {
            var result = MessageBox.Show(Localization.OutputDirectoryNotExist.AsFormat(directory),
                                         Localization.Warning,
                                         MessageBoxButtons.YesNo,
                                         MessageBoxIcon.Warning);

            return result == DialogResult.Yes;
        }

        public static void PromtOutputFileNameInvalid(string fileName)
        {
            MessageBox.Show(Localization.OutputFileNameIsInvalid.AsFormat(fileName),
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);

        }

        public static void PromtOutputFileNotSet()
        {
            MessageBox.Show(Localization.OutputFileNameIsNotSet,
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }

        public static void PromptInputFileNotSet()
        {
            MessageBox.Show(Localization.InputFileIsNotSet,
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }

        public static void PromptInputAndOutputFilesAreSame()
        {
            MessageBox.Show(Localization.InputOutputAreSame,
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Hand);
        }

        public static void InstallationFailed(string message)
        {
            MessageBox.Show(Localization.InstallationFailed.AsFormat(message),
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }


        public static void UninstallationFailed(string message)
        {
            MessageBox.Show(Localization.UninstallFauled.AsFormat(message),
                            Localization.Error,
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }
    
    }
}